package com.itxh.mybatis.model;

import lombok.Data;

import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;

/**
 * 封装整体配置的类
 */
@Data
public class Configuration {
    private DataSource dataSource;
    private Map<String,MappedStatement> mappedStatements = new HashMap<>();

    public void addMappedStatement(String statementId,MappedStatement statement){
        this.mappedStatements.put(statementId, statement);
    }

    public MappedStatement getMappedStatementById(String statementId){
        return this.mappedStatements.get(statementId);
    }

}
